﻿@model Orchard.Core.Containers.ViewModels.ContainerTypePartSettingsViewModel
@{
    Script.Require("ShapesBase");
}
<fieldset>
    @Html.CheckBoxFor(m => m.DisplayContainerEditor)
    @Html.LabelFor(m => m.DisplayContainerEditor, @T("Display settings editor").ToString(), new { @class = "forcheckbox" })
    <span class="hint">@T("When checked, users can change the settings for each content item.")</span>
</fieldset>
<fieldset>
    <label for="@Html.FieldIdFor(m => m.ItemsShownDefault)">@T("Default Items Shown")</label>
    @Html.EditorFor(m => m.ItemsShownDefault)
</fieldset>
<fieldset>
    <label for="@Html.FieldIdFor(m => m.PageSizeDefault)">@T("Default Page Size")</label>
    @Html.EditorFor(m => m.PageSizeDefault)
</fieldset>
<fieldset>
    <label for="@Html.FieldIdFor(m => m.PaginatedDefault)">@T("Show paging controls")</label>
    @Html.EditorFor(m => m.PaginatedDefault)
</fieldset>
<fieldset>
    @Html.LabelFor(m => m.EnablePositioning, @T("Enable drag and drop"))
    @Html.EditorFor(m => m.EnablePositioning)
    <span class="hint">@T("Check this option to enable manual repositioning of items using drag and drop. If not set, this option will be configurable on the content item itself.")</span>
</fieldset>
<fieldset>
    @Html.LabelFor(m => m.AdminListViewName, @T("List View"))
    @Html.EditorFor(m => m.AdminListViewName, new { Providers = Model.ListViewProviders })
    <span class="hint">@T("The default list view to use when rendering this list in the admin. This is configurable per individual list.")</span>
</fieldset>
@if (Model.AvailableItemContentTypes.Any()) {
    <fieldset>
        @Html.CheckBoxFor(m => m.RestrictItemContentTypes)
        @Html.LabelFor(m => m.RestrictItemContentTypes, @T("Restrict the item content types this type supports.").ToString(), new { @class = "forcheckbox" })

        <div data-controllerid="@Html.FieldIdFor(m => m.RestrictItemContentTypes)">
            @Html.LabelFor(m => m.RestrictedItemContentTypes, T("Supported Types"))
            <select name="@Html.FieldNameFor(m => m.RestrictedItemContentTypes)" multiple="multiple" size="10" class="text-box">
                @Html.SelectOption("", !Model.RestrictedItemContentTypes.Any(), T("(Any)").ToString())
                @foreach (var contentType in Model.AvailableItemContentTypes) {
                    @Html.SelectOption(contentType.Name, Model.RestrictedItemContentTypes.Contains(contentType.Name), contentType.DisplayName)
                }
            </select>
            <span class="hint">@T("Select zero or more content types that this content type supports. Selecting zero content types means the list can contain any content type. Only types with the Containable part can be contained in a list.")</span>
        </div>
    </fieldset>
}
